home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shs_doorlocked.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  107 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHS_GenDoor.cog      Make doors open/close.  
  4. #
  5. # [JWC, SXC]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13. message activated
  14. message    startup
  15. message entered
  16. message exited
  17.  
  18. sector     outsidedoor
  19.  
  20. thing    door           
  21. thing   button       
  22. thing    player            local
  23. thing    interpcam
  24.  
  25. int      filter=0         local        # prevent multiple activates    
  26. int        position=0        local        # door position
  27. int     outside=0       local       # inside or outside
  28.  
  29. cog     doortalkcog         
  30.  
  31. end
  32.  
  33. # ========================================================================================
  34.  
  35. code
  36.  
  37.  
  38. startup:
  39.  
  40.     player= GetLocalPlayerThing();
  41.     return;
  42.  
  43. activated:
  44.    
  45.     #  prevent activating with chalk
  46.     if (GetCurItem(player) != 0) return; # prevents activating with chalk
  47.  
  48.     if (GetsenderRef() == button) 
  49.     {
  50.         position=1;        # door has been opened, no need for won't open lines
  51.     }
  52.     if (position == 1) return;    # door has been opened
  53.     
  54.     if (outside == 0) return;    # makes sure indy is outside of door
  55.     
  56.     if ((GetSenderRef() == door) && (filter == 0))
  57.     {
  58.         #Prep...
  59.         SetActorFlags(player, 0x200000);
  60.         StartCutscene(0);
  61.         StopThing(player);
  62.         DeselectWeapon(player);
  63.         DeselectWeaponWait(player);
  64.         
  65.         # Camera stuff
  66.         SetExtCamOffsetToThing(interpCam);
  67.  
  68.         filter=1;
  69.         
  70.         PlayMode(player, 60, 1);
  71.        
  72.         # Call DoorTalkCog, use won't open lines
  73.         Sleep(.3);
  74.         SendMessageEx(doortalkcog, user5, 0, 0, 0, 0);
  75.         global15 = 0; # per Randy
  76.         while (global15 == 0)
  77.         {
  78.             Sleep(0.01); # wait for line to finish
  79.         }
  80.  
  81.         RestoreExtCam();                              
  82.         ClearActorFlags(player, 0x200000);
  83.         EndCutscene();
  84.         filter=0;
  85.     }
  86.     return;
  87.  
  88. entered:
  89.  
  90.     if (GetSenderRef() == outsidedoor)
  91.     {
  92.         outside=1;
  93.     }
  94.     return;
  95.  
  96. exited:
  97.     
  98.     if (GetSenderRef() == outsidedoor)
  99.     {
  100.         outside=0;
  101.     }
  102.     return;
  103.  
  104. end
  105.  
  106.  
  107.